package com.github.catvod.spider.merge;

import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.Arrays;
import java.util.Locale;

public final class UF {
  private int BQ = -1;
  
  private int I;
  
  private Reader V0;
  
  private String[] W = new String[512];
  
  private char[] h;
  
  private int j;
  
  private int oC;
  
  private int q;
  
  private boolean u;
  
  public UF(Reader paramReader) {
    this(paramReader, 32768);
  }
  
  public UF(Reader paramReader, int paramInt) {
    R2.u(paramReader);
    R2.j(paramReader.markSupported());
    this.V0 = paramReader;
    this.h = new char[Math.min(paramInt, 32768)];
    V0();
  }
  
  public UF(String paramString) {
    this(new StringReader(paramString), paramString.length());
  }
  
  static boolean To(char[] paramArrayOfchar, int paramInt1, int paramInt2, String paramString) {
    if (paramInt2 == paramString.length()) {
      for (byte b = 0; paramInt2 != 0; b++) {
        if (paramArrayOfchar[paramInt1] != paramString.charAt(b))
          return false; 
        paramInt1++;
        paramInt2--;
      } 
      return true;
    } 
    return false;
  }
  
  private void V0() {
    if (!this.u) {
      int i = this.I;
      if (i >= this.q) {
        boolean bool;
        int j = this.BQ;
        if (j != -1) {
          bool = i - j;
          i = j;
        } else {
          bool = false;
        } 
        try {
          Reader reader = this.V0;
          long l2 = i;
          long l1 = reader.skip(l2);
          this.V0.mark(32768);
          j = 0;
          while (true) {
            boolean bool1 = true;
            if (j <= 1024) {
              Reader reader1 = this.V0;
              char[] arrayOfChar = this.h;
              int k = reader1.read(arrayOfChar, j, arrayOfChar.length - j);
              if (k == -1)
                this.u = true; 
              if (k <= 0)
                break; 
              j += k;
              continue;
            } 
            break;
          } 
          this.V0.reset();
          if (j > 0) {
            boolean bool1;
            if (l1 != l2)
              bool1 = false; 
            R2.j(bool1);
            this.j = j;
            this.oC += i;
            this.I = bool;
            if (this.BQ != -1)
              this.BQ = 0; 
            this.q = Math.min(j, 24576);
          } 
          return;
        } catch (IOException iOException) {
          throw new m(iOException);
        } 
      } 
    } 
  }
  
  private static String j(char[] paramArrayOfchar, String[] paramArrayOfString, int paramInt1, int paramInt2) {
    String str1;
    if (paramInt2 > 12)
      return new String(paramArrayOfchar, paramInt1, paramInt2); 
    if (paramInt2 < 1)
      return ""; 
    int j = paramInt2 * 31;
    byte b = 0;
    int i;
    for (i = paramInt1; b < paramInt2; i++) {
      j = j * 31 + paramArrayOfchar[i];
      b++;
    } 
    i = j & 0x1FF;
    String str2 = paramArrayOfString[i];
    if (str2 == null) {
      str1 = new String(paramArrayOfchar, paramInt1, paramInt2);
      paramArrayOfString[i] = str1;
    } else {
      if (To((char[])str1, paramInt1, paramInt2, str2))
        return str2; 
      str1 = new String((char[])str1, paramInt1, paramInt2);
      paramArrayOfString[i] = str1;
    } 
    return str1;
  }
  
  private boolean yx() {
    boolean bool;
    if (this.I >= this.j) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  String BQ() {
    String str;
    int j = this.I;
    int k = this.j;
    char[] arrayOfChar = this.h;
    int i = j;
    while (i < k) {
      char c = arrayOfChar[i];
      if (c != '\000' && c != '&' && c != '<')
        i++; 
    } 
    this.I = i;
    if (i > j) {
      str = j(this.h, this.W, j, i - j);
    } else {
      str = "";
    } 
    return str;
  }
  
  boolean C4(char... paramVarArgs) {
    if (PU())
      return false; 
    V0();
    char c = this.h[this.I];
    int i = paramVarArgs.length;
    for (byte b = 0; b < i; b++) {
      if (paramVarArgs[b] == c)
        return true; 
    } 
    return false;
  }
  
  void F() {
    int i = this.I;
    if (i >= 1) {
      this.I = i - 1;
      return;
    } 
    throw new m(new IOException("WTF: No buffer left to unconsume."));
  }
  
  String F8() {
    String str;
    int j = this.I;
    int k = this.j;
    char[] arrayOfChar = this.h;
    int i = j;
    while (i < k) {
      char c = arrayOfChar[i];
      if (c != '\000' && c != '<')
        i++; 
    } 
    this.I = i;
    if (i > j) {
      str = j(this.h, this.W, j, i - j);
    } else {
      str = "";
    } 
    return str;
  }
  
  public char GM() {
    char c;
    V0();
    if (yx()) {
      c = Character.MAX_VALUE;
    } else {
      c = this.h[this.I];
    } 
    return c;
  }
  
  void H9() {
    this.BQ = -1;
  }
  
  char I() {
    char c;
    V0();
    if (yx()) {
      c = Character.MAX_VALUE;
    } else {
      c = this.h[this.I];
    } 
    this.I++;
    return c;
  }
  
  boolean Ig() {
    boolean bool = PU();
    boolean bool1 = false;
    if (bool)
      return false; 
    char c = this.h[this.I];
    bool = bool1;
    if (c >= '0') {
      bool = bool1;
      if (c <= '9')
        bool = true; 
    } 
    return bool;
  }
  
  boolean LW(String paramString) {
    V0();
    if (b(paramString)) {
      this.I += paramString.length();
      return true;
    } 
    return false;
  }
  
  boolean Og(String paramString) {
    if (l(paramString)) {
      this.I += paramString.length();
      return true;
    } 
    return false;
  }
  
  String PD() {
    V0();
    char[] arrayOfChar = this.h;
    String[] arrayOfString = this.W;
    int i = this.I;
    String str = j(arrayOfChar, arrayOfString, i, this.j - i);
    this.I = this.j;
    return str;
  }
  
  public boolean PU() {
    boolean bool;
    V0();
    if (this.I >= this.j) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  String Qy() {
    V0();
    int i = this.I;
    while (true) {
      int j = this.I;
      if (j < this.j) {
        char c = this.h[j];
        if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || Character.isLetter(c)) {
          this.I++;
          continue;
        } 
      } 
      break;
    } 
    return j(this.h, this.W, i, this.I - i);
  }
  
  boolean R(char paramChar) {
    boolean bool;
    if (!PU() && this.h[this.I] == paramChar) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  int T(CharSequence paramCharSequence) {
    V0();
    char c = paramCharSequence.charAt(0);
    int i = this.I;
    while (i < this.j) {
      char c1 = this.h[i];
      byte b = 1;
      int j = i;
      if (c != c1)
        while (true) {
          j = ++i;
          if (i < this.j) {
            j = i;
            if (c != this.h[i])
              continue; 
          } 
          break;
        }  
      i = j + 1;
      int m = paramCharSequence.length() + i - 1;
      int k = this.j;
      if (j < k && m <= k) {
        k = i;
        while (k < m && paramCharSequence.charAt(b) == this.h[k]) {
          k++;
          b++;
        } 
        if (k == m)
          return j - this.I; 
      } 
    } 
    return -1;
  }
  
  public int V() {
    return this.oC + this.I;
  }
  
  String W() {
    int j;
    V0();
    int i = this.I;
    while (true) {
      j = this.I;
      if (j < this.j) {
        char c = this.h[j];
        if (c >= '0' && c <= '9') {
          this.I = j + 1;
          continue;
        } 
      } 
      break;
    } 
    return j(this.h, this.W, i, j - i);
  }
  
  boolean b(String paramString) {
    V0();
    int i = paramString.length();
    if (i > this.j - this.I)
      return false; 
    for (byte b = 0; b < i; b++) {
      if (paramString.charAt(b) != this.h[this.I + b])
        return false; 
    } 
    return true;
  }
  
  boolean f(char[] paramArrayOfchar) {
    boolean bool;
    V0();
    if (!PU() && Arrays.binarySearch(paramArrayOfchar, this.h[this.I]) >= 0) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  public void h() {
    this.I++;
  }
  
  public String i4(char... paramVarArgs) {
    String str;
    V0();
    int j = this.I;
    int k = this.j;
    char[] arrayOfChar = this.h;
    int m = paramVarArgs.length;
    int i;
    label19: for (i = j; i < k; i++) {
      for (byte b = 0; b < m; b++) {
        if (arrayOfChar[i] == paramVarArgs[b])
          break label19; 
      } 
    } 
    this.I = i;
    if (i > j) {
      str = j(this.h, this.W, j, i - j);
    } else {
      str = "";
    } 
    return str;
  }
  
  String iU(String paramString) {
    int i = T(paramString);
    if (i != -1) {
      paramString = j(this.h, this.W, this.I, i);
      this.I += i;
      return paramString;
    } 
    if (this.j - this.I < paramString.length())
      return PD(); 
    i = this.j - paramString.length() + 1;
    char[] arrayOfChar = this.h;
    String[] arrayOfString = this.W;
    int j = this.I;
    String str = j(arrayOfChar, arrayOfString, j, i - j);
    this.I = i;
    return str;
  }
  
  boolean j5(String paramString) {
    Locale locale = Locale.ENGLISH;
    String str = paramString.toLowerCase(locale);
    paramString = paramString.toUpperCase(locale);
    return (T(str) > -1 || T(paramString) > -1);
  }
  
  boolean l(String paramString) {
    V0();
    int i = paramString.length();
    if (i > this.j - this.I)
      return false; 
    for (byte b = 0; b < i; b++) {
      if (Character.toUpperCase(paramString.charAt(b)) != Character.toUpperCase(this.h[this.I + b]))
        return false; 
    } 
    return true;
  }
  
  public String n(char paramChar) {
    int i = rd(paramChar);
    if (i != -1) {
      String str = j(this.h, this.W, this.I, i);
      this.I += i;
      return str;
    } 
    return PD();
  }
  
  boolean nf() {
    boolean bool1 = PU();
    boolean bool = false;
    if (bool1)
      return false; 
    char c = this.h[this.I];
    if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || Character.isLetter(c))
      bool = true; 
    return bool;
  }
  
  String oC(boolean paramBoolean) {
    String str;
    int j = this.I;
    int k = this.j;
    char[] arrayOfChar = this.h;
    int i;
    for (i = j; i < k; i++) {
      char c = arrayOfChar[i];
      if (c != '\000') {
        if (c != '"')
          if (c != '&') {
            if (c != '\'')
              continue; 
            if (paramBoolean)
              break; 
          } else {
            break;
          }  
        if (!paramBoolean)
          break; 
        continue;
      } 
    } 
    this.I = i;
    if (i > j) {
      str = j(this.h, this.W, j, i - j);
    } else {
      str = "";
    } 
    return str;
  }
  
  String oq() {
    V0();
    int i = this.I;
    while (true) {
      int j = this.I;
      if (j < this.j) {
        char c = this.h[j];
        if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || Character.isLetter(c)) {
          this.I++;
          continue;
        } 
      } 
      break;
    } 
    while (!yx()) {
      char[] arrayOfChar = this.h;
      int j = this.I;
      char c = arrayOfChar[j];
      if (c >= '0' && c <= '9')
        this.I = j + 1; 
    } 
    return j(this.h, this.W, i, this.I - i);
  }
  
  public void q() {
    null = this.V0;
    if (null == null)
      return; 
    try {
      null.close();
    } catch (IOException iOException) {
    
    } finally {
      this.V0 = null;
      this.h = null;
      this.W = null;
    } 
  }
  
  int rd(char paramChar) {
    V0();
    for (int i = this.I; i < this.j; i++) {
      if (paramChar == this.h[i])
        return i - this.I; 
    } 
    return -1;
  }
  
  String t() {
    String str;
    V0();
    int j = this.I;
    int k = this.j;
    char[] arrayOfChar = this.h;
    int i = j;
    while (i < k) {
      char c = arrayOfChar[i];
      if (c != '\000' && c != ' ' && c != '/' && c != '<' && c != '>' && c != '\t' && c != '\n' && c != '\f' && c != '\r')
        i++; 
    } 
    this.I = i;
    if (i > j) {
      str = j(this.h, this.W, j, i - j);
    } else {
      str = "";
    } 
    return str;
  }
  
  public String toString() {
    if (this.j - this.I < 0)
      return ""; 
    char[] arrayOfChar = this.h;
    int i = this.I;
    return new String(arrayOfChar, i, this.j - i);
  }
  
  String u() {
    int j;
    V0();
    int i = this.I;
    while (true) {
      j = this.I;
      if (j < this.j) {
        char c = this.h[j];
        if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) {
          this.I = j + 1;
          continue;
        } 
      } 
      break;
    } 
    return j(this.h, this.W, i, j - i);
  }
  
  void w4() {
    if (this.j - this.I < 1024)
      this.q = 0; 
    V0();
    this.BQ = this.I;
  }
  
  String y(char... paramVarArgs) {
    String str;
    V0();
    int j = this.I;
    int k = this.j;
    char[] arrayOfChar = this.h;
    int i;
    for (i = j; i < k && Arrays.binarySearch(paramVarArgs, arrayOfChar[i]) < 0; i++);
    this.I = i;
    if (i > j) {
      str = j(this.h, this.W, j, i - j);
    } else {
      str = "";
    } 
    return str;
  }
  
  void z() {
    int i = this.BQ;
    if (i != -1) {
      this.I = i;
      H9();
      return;
    } 
    throw new m(new IOException("Mark invalid"));
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/UF.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */